<extend name="Public/base"/>

<block name="body">
	<!-- 标题栏 -->
	<div class="main-title">
		<h2>{:L("_BEHAVIOR_LOG_")}&nbsp;&nbsp;&nbsp;<sub style="color: red">{:L("_THE_LONGTERM_ACCUMULATION_OF_BEHAVIOR_LOG_WILL_LEAD_TO_THE_WHOLE_SYSTEM_PERFORMANCE_DEGRADATION_")}</sub></h2>
	</div>
    <div class="clearfix">
        <div class="col-xs-8">
                <button class="btn ajax-get confirm" url="{:U('clear')}">{:L("_CLEARANCE_WITH_SPACE_")}</button>
                <button class="btn ajax-post confirm" target-form="ids" url="{:U('remove')}">{:L("_DELETE_WITH_SPACE_")}</button>
        </div>

        <div class="col-xs-4">
            <div class="search-form  pull-right">
                <div class="input-group" style="width: 200px" >
                    <input type="text" name="uid" class="search-input form-control" value="{:I('get.uid','','intval')}"
                           placeholder={:L("_PLEASE_ENTER_THE_USER_UID_WITH_DOUBLE_")}>
                    <span class="input-group-btn">  <a class="btn btn-default" href="javascript:;" id="search"
                                                       url="{:U('Action/actionlog')}"><i
                            class="icon-search"></i></a></span>
                </div>
            </div>
        </div>
    </div>

	<!-- 数据列表 -->
	<div class="data-table with-padding">
	<table class="table table-bordered table-striped ">
    <thead>
        <tr>
		<th class="row-selected row-selected"><input class="check-all" type="checkbox"/></th>
		<th class="">{:L("_NO_")}</th>
		<th class="">{:L("_BEHAVIOR_NAME_")}</th>
		<th class="">{:L("_EXECUTIVE_")}</th>
        <th class="">{:L("_LOG_CONTENT_")}</th>
		<th class="">{:L("_EXECUTION_TIME_")}</th>
		<th class="">{:L("_OPERATION_")}</th>
		</tr>
    </thead>
    <tbody>
		<notempty name="_list">
		<volist name="_list" id="vo">
		<tr>
            <td><input class="ids" type="checkbox" name="ids[]" value="{$vo.id}" /></td>
			<td>{$vo.id} </td>
			<td>{:get_action($vo['action_id'],'title')}</td>
			<td><a href="{:U('Action/actionlog',array('uid'=>$vo['user_id']))}">{:get_nickname($vo['user_id'])}</a></td>
            <td>{$vo['remark']}</td>
			<td><span>{$vo.create_time|time_format}</span></td>
			<td><a href="{:U('Action/edit?id='.$vo['id'])}">{:L("_DETAILED_")}</a>
				<a class="confirm ajax-get" href="{:U('Action/remove?ids='.$vo['id'])}">{:L("_DELETE_")}</a>
                </td>
		</tr>
		</volist>
		<else/>
		<td colspan="7" class="text-center"> aOh!{:L("_THERE_IS_NO_CONTENT_")} </td>
		</notempty>
	</tbody>
    </table>
	</div>
	<!-- 分页 -->
	<div class="with-padding">{$_page}</div>
	<!-- /分页-->

</block>
<block name="script">
<script type="text/javascript">
$(function(){
    $("#search").click(function () {
        var url = $(this).attr('url');
        var query = $('.search-form').find('input').serialize();
        query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g, '');
        query = query.replace(/^&/g, '');
        if (url.indexOf('?') > 0) {
            url += '&' + query;
        } else {
            url += '?' + query;
        }
        window.location.href = url;
    });

    $("#action_add").click(function(){
		window.location.href = $(this).attr('url');
	});
    //回车搜索
    $(".search-input").keyup(function (e) {
        if (e.keyCode === 13) {
            $("#search").click();
            return false;
        }
    });
})
</script>
</block>
